<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
		<link rel="stylesheet" href="blueviolin.css" type="text/css"/>
		<script language="javascript" src="replay.js">
		</script>
		<script language="javascript" src="appevents.js">
		</script>
		<script language="javascript" src="menu.js" >
		</script>
		<script language="javascript" src="toolbar.js">
		</script>
		<script language="javascript">
// var g_bMouseClicked = false;
// var g_objElementClicked = null;
// var g_nNextDocument = 0;
// var g_nActiveWorkspace = -1;
// var g_nNextPopup = 0;
// var g_nActivePopup = 0;
// var g_objActiveBrowser = null;

// var g_aBrowsers = new Array();

window.g_bvMenu = new BVMenu();
window.g_bvToolbar = new BVToolbar();
window.g_bvAppEvents = new BVAppEvents("objIEBrowser");
window.g_bvReplay = new BVReplay();
		</script>

<script language="javascript" for="objIEBrowser" event="TitleChange(strText)" id="jsBrowser_TitleChange">
g_bvAppEvents.TitleChange(strText);
</script>

<script language="javascript" for="objIEBrowser" event="StatusTextChange(strText)" id="jsBrowser_StatusTextChange">
g_bvAppEvents.StatusTextChange(strText);
</script>

<script language="javascript" for="objIEBrowser" event="ProgressChange(nProgress, nProgressMax)" id="jsBrowser_ProgressChange">
// jw
// need to figure out a way to display progress
// var objDiv = document.all("divWorkspace" + g_nActiveWorkspace);
// objDiv.all("spnIEBrowserProgress").innerText = nProgress + " / " + nProgressMax; 
</script>

<script language="javascript" for="objIEBrowser" event="NavigateComplete2(strURL)" id="jsBrowser_NavigateComplete2">
// document.all("txtToolbarAddress").value = strURL;
// SetToolbarURL(strURL);
g_bvAppEvents.NavigateComplete(strURL);
</script>

<script language="javascript" for="objIEBrowser" event="DocumentComplete(objDocument, strURL)" id="jsBrowser_DocumentComplete">
// ActionTreeAddNode("Document Complete", strURL);
g_bvAppEvents.DocumentComplete();
</script>

<script language="javascript" for="objIEBrowser" event="ElementOnClick(oElement, oEvent)" id="jsBrowser_ElementOnClick">
g_bvAppEvents.ElementOnClick(oElement, oEvent);
</script>


<script language="javascript" for="objIEBrowser" event="TextInputOnChange(strTagName, strValue)" id="jsBrowser_TextInputOnChange">
// var objTemp = new Object;
// objTemp.bvAction = "TextInputOnChange";
// objTemp.id = strTagName;
// objTemp.value = strValue;
// AddActionNode(objTemp, null);
</script>

<script language="javascript" for="objIEBrowser" event="FormOnSubmit(objElement)" id="jsBrowser_FormOnSubmit">
objElement.bvAction = objElement.tagName;
AddActionNode(objElement, null);
</script>

<script language="javascript" for="objIEBrowser" event="SelectOnChange(oElement, oEvent)" id="jsBrowser_SelectOnChange">
// objElement.bvAction = objElement.tagName;
// AddActionNode(objElement, null);
g_bvAppEvents.SelectOnChange(oElement, oEvent);
</script>

<script language="javascript" for="objIEBrowser" event="InputFileOnChange(objElement)" id="jsBrowser_InputFileOnChange">
objElement.bvAction = objElement.tagName;
AddActionNode(objElement, null);
</script>

<script language="javascript" for="objIEBrowser" event="GetNewWindow(strBrowserID)" id="jsBrowser_GetNewWindow">
g_bvAppEvents.GetNewWindow(strBrowserID);
</script>

<script language="javascript" for="" event="BrowserCreated()" id="jsBrowser_BrowserCreated">
g_bvAppEvents.BrowserCreated();
</script>

<script language="javascript" for="objIEBrowser" event="WindowClosing(strBrowserID)" id="jsBrowser_WindowClosing">
strName = strBrowserID.replace("obj", "");
alert(document.all("spn" + strName).id);
// alert(strName);

// document.all("div" + strName).removeNode(false);

var aScripts = document.scripts;
var reMatch = new RegExp(strBrowserID);
for (i = 0;
	 i < aScripts.length;
	 i++)
{
	if (strBrowserID == aScripts[i].id.match(reMatch))
	{
		aScripts[i].htmlFor = "";
	}
}
// document.all(strBrowserID).removeNode(false);
document.all("spn" + strName).removeNode(true);
document.all("div" + strName).style.zIndex = "-10";

// divBrowser = document.all("div" + strBrowserID);
// divBrowser.removeNode(true);

// var strHtmlFor;
// var objWorkspace;
// var objBrowser;
// var divBrowser;

// strHtmlFor = document.all("jsWindowClosing").htmlFor;
// objWorkspace = document.all("divWorkspace" + g_nActiveWorkspace);
// objBrowser = objWorkspace.all(strHtmlFor);
// divBrowser = objBrowser.parentElement;
// objBrowser.removeNode(false);
// divBrowser.removeNode(true);
// alert(divBrowser.id);
// objWorkspace.removeChild(divBrowser);


// alert(document.all("jsWindowClosing").htmlFor);
</script>

<script language="javascript" for="objIEBrowser" event="KeyPress(elemSrc, evEvent)" id="jsBrowser_KeyDown">
g_bvAppEvents.KeyPress(elemSrc, evEvent);
</script>

<script language="javascript" for="objIEBrowser" event="CommandStateChange(nCommand, bEnabled)" id="jsBrowser_CommandStateChange">
g_bvToolbar.CommandStateChange(nCommand, bEnabled);
</script>


		<script language="javascript">
function d2h(d) 
{
	var hD="0123456789ABCDEF";
	var h = hD.substr(d&15,1);
	while(d>15) 
	{
		d>>=4;
		h=hD.substr(d&15,1)+h;
	}
	return h;
}


		</script>
	</head>
		<body id="bodyMain" onclick="g_bvMenu.MenuExpand(g_bvMenu.elemClicked);">
			<div id="divMenu">	
				<img src="icon.gif" style="height: 100%; vertical-align: middle;" title="Blue Violin - web testing that sucks less"/>
				<span id="spnMenuFile" style="width: 3em" unselectable="on">File</span>
				<span id="spnMenuEdit" style="width: 3em;" unselectable="on">Edit</span>
				<span id="spnMenuOptions" style="width: 4em;" unselectable="on">Options</span>
				<span id="spnMenuFunctions" style="width: 6em" unselectable="on">Functions</span>
			</div>
			<!-- sub menus -->
			<div id="divSubMenus">
				<div id="divSubMenuFile" class="SubMenu">
					<div class="SubMenuItem" title="Create a new workspace" unselectable="on">New</div>
					<hr/>
					<div id="divSubMenuFileReplay" class="SubMenuItem" title="Replay your events" unselectable="on">Replay</div>
				</div>		  
				<div id="divSubMenuEdit" class="SubMenu">
					<div class="SubMenuItem" id="divSubMenuEditCut" unselectable="on">Cut</div>
					<div class="SubMenuItem" id="divSubMenuEditCopy" unselectable="on">Copy</div>
					<div class="SubMenuItem" id="divSubMenuEditPaste" unselectable="on">Paste</div>
				</div>
				<div id="divSubMenuOptions" class="SubMenu">
					<div class="SubMenuItem" id="divSubMenuOptionsOnmousedown" unselectable="on">
						onmousedown = mouse click
					</div>
				</div>
				<div id="divSubMenuFunctions" class="SubMenu">
					<div class="SubMenuItem" unselectable="on">Reload DOM</div>
					<div class="SubMenuItem" unselectable="on">Clear Events</div>
					<div class="SubMenuItem" unselectable="on">View XML</div>
				</div>
			</div>
			<div id="divToolbar">
				<span id="spnToolbarBack" title="Back" unselectable="on"></span>
				<span id="spnToolbarForward" title="Forward" unselectable="on"></span>
				<span id="spnToolbarCancel" title="Cancel" unselectable="on"></span>
				<span id="spnToolbarRefresh" title="Refresh" unselectable="on"></span>
				<span id="spnToolbarHome" title="Phone Home" unselectable="on"></span>
				<!-- <label id="lblToolbarURL" for="txtToolbarAddress">URL</label> -->
				<input type="text" id="txtToolbarAddress" title="Enter a URL to load"/>
				<span id="spnToolbarOK" title="Go!" unselectable="on"></span>
			</div>
			<div id="divPopupTabs">
				<span id="spnMainBrowser" class="PopupTabsSpan">
					Main Browser
				</span>
			</div>
			<div id="divWorkspace">
				<div id="spnActionTree" class="ActionTree">
					<ol id="ulTree">
					</ol>
				</div><div id="divBrowsers" class="IEBrowsers">
					<div id="divIEBrowser">
						<!-- http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp -->
						<script src="loadratchet.js"></script>
					</div>
				</div>
			</div>
		</body>
</html>



